<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			var stus = [
				{ id: 100, name: 'why', age: 18 },
				{ id: 101, name: 'why1', age: 18 },
				{ id: 102, name: 'why2', age: 18 },
			]

			// 返回的是数组
			var res = stus.filter(function (item) {
				return item.id === 101
			})

			// 返回的数组中的某个对象
			var res1 = stus.find(function (item) {
				return item.id === 101
			})

			console.log('res, res1:', res, res1)
		</script>
	</body>
</html>
